package com.example.spring_demo.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @className: BeanConfig
 * @author: 芃
 * @description:
 * @date: 2024/12/23 14:00
 */
@Configuration
public class BeanConfig {
    @Bean
    public String name(){
        return "芃";
    }

    @Bean
    public String name2(){
        return "豆";
    }


    @Bean
    public UserInfo userInfo(String name) {
        UserInfo userInfo = new UserInfo();
        userInfo.setId(1);
        userInfo.setName(name);
        userInfo.setAge(20);
        return userInfo;
    }


    @Bean
    public UserInfo userInfo2(String name2) {
        UserInfo userInfo = new UserInfo();
        userInfo.setId(1);
        userInfo.setName(name2);
        userInfo.setAge(20);
        return userInfo;
    }
}
